package cn.itcast.service.impl;

import cn.itcast.dao.StudentDao;
import cn.itcast.domain.Student;
import cn.itcast.service.BaseService;
import cn.itcast.utils.MyUtils;

import java.util.ArrayList;

public class BaseServiceImpl implements BaseService {
    StudentDao studentDao = MyUtils.getStudentDao();
    @Override
    public Student findByStudentnameAndPassword(String username, String password) {
        return studentDao.findByStudentnameAndPassword(username, password);
    }

    @Override
    public ArrayList<Student> findAllStudent() {
        return studentDao.findAllStudent();
    }

    @Override
    public int insertStudent(String username, String password) {
        return studentDao.insertStudent(username, password);
    }

    @Override
    public void deleteStudent(Integer id) {
        studentDao.deleteStudent(id);
    }

    @Override
    public void updateStudent(Student stu) {
        studentDao.updateStudent(stu);
    }

    @Override
    public Student findStudentById(int update_id) {
        return studentDao.findStudentById(update_id);
    }
}
